# 引入项目通用 cmake 设置
include(common)

if (DEFINED COMMON_THIRD_LIB)
  set(YAMLCPP_ROOT ${COMMON_THIRD_LIB}/yaml-cpp/dist)
endif()

# =============================================================================
macro(use_yaml ag_project_name)
  target_compile_definitions(${ag_project_name} PRIVATE USE_LIB_YAML)
  target_compile_definitions(${ag_project_name} PRIVATE YAML_CPP_STATIC_DEFINE)
  
  target_include_directories(${ag_project_name} PRIVATE ${YAMLCPP_ROOT}/$<CONFIG>/include)
  
  target_link_directories(${ag_project_name} PRIVATE ${YAMLCPP_ROOT}/$<CONFIG>/lib)
  target_link_libraries(${ag_project_name} PRIVATE yaml-cpp$<$<CONFIG:Debug>:d>)
endmacro(use_yaml)